import request from "@/utils/request.js";

// 获取应急处置列表
export const getEmergencyActionList = (data) => {
    return request({
        method: 'post',
        url: '/bussiness/MANAGMENT/list',
        data: data,
        isEncrypt: false
    })
}

// 新增应急处置
export const addEmergencyAction = (data) => {
    return request({
        method: 'post',
        url: '/bussiness/MANAGMENT/add',
        data: data,
        isEncrypt: false
    })
}

// 更新应急处置内容
export const updateEmergencyAction = (data) => {
    return request({
        method: 'post',
        url: '/bussiness/MANAGMENT/edit',
        data: data,
        isEncrypt: false
    })
}

// 删除应急处置
export const deleteEmergencyAction = (id) => {
    return request({
        method: 'post',
        url: '/bussiness/MANAGMENT/remove',
        params: {
            id: id
        },
        isEncrypt: false
    })
}

// 结束应急处置
export const endEmergencyAction = (id) => {
    return request({
        method: 'post',
        url: '/bussiness/MANAGMENT/over',
        data: {
            managementId: id
        },
        isEncrypt: false
    })
}

// 获取应急处置详情
export const getEmergencyActionInfo = (id) => {
    return request({
        method: 'get',
        url: '/bussiness/MANAGMENT/info',
        params: {
            id: id
        },
        isEncrypt: false
    })
}

// 获取某应急处置下的任务
export const getTaskListByEmergencyActionId = (managementId, query = {}) => {
    return request({
        method: 'post',
        url: '/bussiness/TASK/manageList',
        params: query,
        data: {
            managementId: managementId
        },
        isEncrypt: false
    })
}

// 新增对应应急处置的任务
export const addEmergencyActionTask = (data) => {
    return request({
        method: 'post',
        url: '/bussiness/TASK/add',
        data: data,
        isEncrypt: false
    })
}
// 获取任务详情
export const getTaskInfoByTaskId = (id) => {
    return request({
        method: 'get',
        url: '/bussiness/TASK/info',
        params: {
            id: id
        }
    })
}

// 修改任务
export const updateEmergencyActionTask = (data) => {
    return request({
        method: 'post',
        url: '/bussiness/TASK/edit',
        data: data,
        isEncrypt: false
    })
}

// 删除任务
export const deleteEmergencyActionTask = (id) => {
    return request({
        method: 'post',
        url: '/bussiness/TASK/remove',
        params: {
            id: id
        },
        isEncrypt: false
    })
}

// 应急处置查询·领导版
export const getEmergencyActionListLeader = (data, query = {}) => {
    return request({
        method: 'post',
        url: '/bussiness/MANAGMENT/leaderList',
        data: data,
        params: query,
        isEncrypt: false
    })
}